package com.ssy.lingxi.after.sale.api.feign;

import com.ssy.lingxi.after.sale.api.model.vo.request.*;
import com.ssy.lingxi.after.sale.api.model.vo.response.ReturnGoodsDetailListResponse;
import com.ssy.lingxi.after.sale.api.model.vo.response.ReturnGoodsInfoVO;
import com.ssy.lingxi.after.sale.api.model.vo.response.ReturnGoodsTaxVO;
import com.ssy.lingxi.common.response.Wrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;

/**
 * 售后退货内部接口
 * @author 伍将
 * @date 2020/12/22
 * @version 2.0.0
 */
@FeignClient(name = "after-sale-service")
public interface ReturnGoodsControllerFeign {

    /**
     * 售后退货-新增退货发货单
     * @author 伍将
     * @date 2020/9/24
     **/
    @RequestMapping("/as/feign/returnGoods/addReturnDeliveryGoods")
    Wrapper<Long> addReturnDeliveryGoods(@RequestBody @Valid ReturnAddDeliveryGoodsVO addVO);

    /**
     * 售后退货-删除退货发货单
     * @author 伍将
     * @date 2020/9/29
     **/
    @RequestMapping("/as/feign/returnGoods/deleteReturnDeliveryGoods")
    Wrapper deleteReturnDeliveryGoods(@RequestBody @Valid CommonIdVO commonIdVO);

    /**
     * 售后退货-审核退货发货单
     * @author 伍将
     * @date 2020/12/22
     **/
    @RequestMapping("/as/feign/returnGoods/verifyReturnDeliveryGoods")
    Wrapper verifyReturnDeliveryGoods(@RequestBody @Valid VerifyDeliveryVO verifyVO);

    /**
     * 售后退货-新增退货入库单
     * @author 伍将
     * @date 2020/9/24
     **/
    @RequestMapping("/as/feign/returnGoods/addReturnGoodsStorage")
    Wrapper addReturnGoodsStorage(@RequestBody @Valid ReturnAddStorageVO addVO);

    /**
     * 售后退货-删除退货入库单
     * @author 伍将
     * @date 2020/9/29
     **/
    @RequestMapping("/as/feign/returnGoods/deleteReturnGoodsStorage")
    Wrapper deleteReturnGoodsStorage(@RequestBody @Valid CommonIdVO commonIdVO);

    /**
     * 售后退货-审核退货入库单
     * @author 伍将
     * @date 2020/12/22
     **/
    @RequestMapping("/as/feign/returnGoods/verifyReturnGoodsStorage")
    Wrapper verifyReturnGoodsStorage(@RequestBody @Valid VerifyDeliveryVO verifyVO);

    /**
     * 售后退货-新增退货物流(退货-退货发货)
     * @author 伍将
     * @date 2020/9/24
     **/
    @RequestMapping("/as/feign/returnGoods/addReturnLogistics")
    Wrapper addReturnLogistics(@RequestBody @Valid AddLogisticsVO addVO);

    /**
     * 售后退货-审核退货物流单(退货-退货发货)
     * @author 伍将
     * @date 2020/9/24
     **/
    @RequestMapping("/as/feign/returnGoods/verifyReturnLogistics")
    Wrapper verifyReturnLogistics(@RequestBody @Valid VerifyLogisticsVO verifyVO);

    /**
     * 查询退货订单
     * @author 伍将
     * @date 2021/1/27
     **/
    @RequestMapping(value = "/as/feign/returnGoods/getOrderList", method = RequestMethod.GET)
    Wrapper<List<String>> getOrderList(@RequestParam("applyNo") String applyNo);

    /**
     * 查询是否允许支付
     * @author 伍将
     * @date 2021/1/28
     **/
    @RequestMapping(value = "/as/feign/returnGoods/isAllowPay")
    Wrapper isAllowPay(@RequestBody @Valid AllowPayVO payVO);

    /**
     * 根据退货订单ids,查询退货订单信息（状态）列表
     * @author ds
     * @date 2021/4/9
     **/
    @RequestMapping(value = "/as/feign/returnGoods/getOrderInfoListByIds")
    Wrapper<List<ReturnGoodsInfoVO>> getOrderInfoListByIds(@RequestBody @Valid List<Long> returnGoodsIds);

    /**
     * 根据合同id，查询合同下的退款单列表
     * @author ds
     * @date 2021/4/9
     **/
    @RequestMapping(value = "/as/feign/returnGoods/getOrderListByContractId")
    Wrapper<List<ReturnGoodsDetailListResponse>> getOrderListByContractId(@RequestBody @Valid ReturnListGoodsDetailVO request);

    /**
     * 根据退货订单ids,查询退货订单信息（状态）列表
     * @author ds
     * @date 2021/4/9
     **/
    @RequestMapping(value = "/as/feign/returnGoods/getOrderInfoListByIdsAndSkuIds")
    Wrapper<List<ReturnGoodsTaxVO>> getOrderInfoListByIdsAndSkuIds(@RequestBody @Valid ReturnDetailReqVO request);

}
